<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"/>
    <title></title>
    <script src="js/mui.min.js"></script>
    <link href="css/mui.min.css" rel="stylesheet"/>
    <link href="css/mobiscroll.css" rel="stylesheet"/>
    <script src="js/websql.js"></script>
    <script src="js/jquery.min.js"></script>
    <script src="js/mobiscroll1.js"></script>
    <script src="js/mobiscroll2.js"></script>
    <script src="js/md5.js"></script>
    <script src="js/common.js"></script>
    <script src="js/oa/mate.js"></script>
    <script src="js/oa/notice.js"></script>
    <script src="js/oa/apply.js"></script>
    <script src="js/oa/find.js"></script>
    <script src="js/oa/my.js"></script>
    <script src="js/oa/share.js"></script>
    <script src="js/oa/daily.js"></script>
    <script src="js/oa/task.js"></script>
    <script src="js/oa/examine.js"></script>
    <script src="js/oa/login.js"></script>
    <script src="js/oa/regist.js"></script>
    <script src="js/oa/enter.js"></script>
    <script src="js/oa/mateinfo.js"></script>
    <script src="js/oa/signreport.js"></script>
    <script src="js/oa/notepad.js"></script>
    <script src="js/oa/publish.js"></script>
    <script src="js/oa/checkmate.js"></script>
    <script src="js/crm/customer.js"></script>
    <script src="js/crm/customerhighsea.js"></script>
    <script src="js/crm/customernear.js"></script>
    <script src="js/crm/customercheck.js"></script>
    <script src="js/crm/customerinfo.js"></script>
    <script src="js/crm/customeradd.js"></script>
    <script src="js/crm/salerecordadd.js"></script>
    <script src="js/crm/order.js"></script>
    <script src="js/crm/orderselect.js"></script>
    <script src="js/crm/orderinfo.js"></script>
    <script src="js/crm/orderadd.js"></script>
    <script src="js/crm/customerselect.js"></script>
    <script src="js/crm/productselect.js"></script>
    <script src="js/crm/ordersend.js"></script>
    <script src="js/crm/contract.js"></script>
    <script src="js/crm/contractadd.js"></script>
    <script src="js/crm/contractinfo.js"></script>
    <script src="js/crm/inventory.js"></script>
    <script src="js/crm/payrecord.js"></script>
    <script src="js/crm/payrecordadd.js"></script>
    <script src="js/crm/purchase.js"></script>
    <script src="js/crm/purchaseadd.js"></script>
    <script src="js/crm/purchaseinfo.js"></script>
    <script src="js/crm/supplierselect.js"></script>
    <script src="js/oa/oapanel.js"></script>
    <script src="js/oa/crmpanel.js"></script>
    <script src="js/oa/hrpanel.js"></script>
    <script src="js/crm/contact.js"></script>
    <script src="js/crm/contactselect.js"></script>
    <script src="js/crm/contactadd.js"></script>
    <script src="js/crm/contactinfo.js"></script>
    <script src="js/crm/product.js"></script>
    <script src="js/crm/productadd.js"></script>
    <script src="js/crm/productinfo.js"></script>
    <script src="js/crm/category.js"></script>
    <script src="js/crm/categoryadd.js"></script>
    <script src="js/crm/library.js"></script>
    <script src="js/crm/libraryadd.js"></script>
    <script src="js/crm/libraryinfo.js"></script>
    <script src="js/crm/supplier.js"></script>
    <script src="js/crm/supplieradd.js"></script>
    <script src="js/crm/supplierinfo.js"></script>
    <script src="js/crm/movement.js"></script>
    <script src="js/crm/movementadd.js"></script>
    <script src="js/crm/movementinfo.js"></script>
    <script src="js/oa/user.js"></script>
    <script src="js/oa/useradd.js"></script>
    <script src="js/oa/userinfo.js"></script>
    <script src="js/oa/schedule.js"></script>
    <script src="js/oa/depart.js"></script>
    <script src="js/oa/departadd.js"></script>
    <script src="js/oa/signrule.js"></script>
    <script src="js/oa/signruleadd.js"></script>
    <script src="js/oa/signadd.js"></script>
    <script src="js/oa/circle.js"></script>
    <script src="js/oa/weiyingxiao.js"></script>
    <script src="js/oa/usercenter.js"></script>
    <script src="js/oa/question.js"></script>
    <script src="js/oa/set.js"></script>
    <script src="js/crm/saletarget.js"></script>
    <script src="js/oa/addapp.js"></script>
    <script src="js/oa/vote.js"></script>
    <script src="js/oa/agency.js"></script>
    <script src="js/hr/salary.js"></script>
    <script src="js/hr/agreement.js"></script>
    <script src="js/hr/security.js"></script>
    <script src="js/hr/employ.js"></script>
    <script src="js/hr/reward.js"></script>
    <script src="js/hr/wages.js"></script>
    <link href="css/common.css" rel="stylesheet"/>
    <script type="text/javascript" src="js/iscroll.js"></script>
    <script src="js/binaryajax.js" type="text/javascript" charset="utf-8"></script>
    <script src="js/exif.js" type="text/javascript" charset="utf-8"></script>
    <script src="js/canvasResize.js" type="text/javascript" charset="utf-8"></script>
    <script src="js/cropper.min.js" type="text/javascript" charset="utf-8"></script>
	<link href="css/cropper.min.css" rel="stylesheet">
    <link rel="stylesheet" href="css/photoswipe.css">
	<link rel="stylesheet" href="css/default-skin.css">
	<script src="js/photoswipe.min.js"></script>
	<script src="js/photoswipe-ui-default.min.js"></script>
    <script type="text/javascript" charset="utf-8">
    
    //document.addEventListener('touchmove', function (e) { e.preventDefault(); }, false); //加上后，首页列表和同事列表将不能下拉
    var addcrm,addoa,addhr;
    
    (function($$, doc) {
      	mui.init({gestureConfig:{tap: true,longtap: true}});
      	mui.plusReady(function(){
      		plus.runtime.getProperty(plus.runtime.appid, function(inf) {
      			editions=inf.version;
      		});
      		if(plus.device.vendor=="Apple")
			{
				source=3;
			}else{
				source=2;
			}
      		plus.push.addEventListener( "click", function( msg ) {
		        // 判断是从本地创建还是离线推送的消息
		        if($("#iframe .title .name").html()=="消息"){
		        	Init_Notice();
		        }else{
		        	Init_Message();
		        }
		    }, false );
		    plus.push.addEventListener( "receive", function( msg ) {
		    	if(msg.payload=="1" || msg.payload==null)
		    	{
		    		Inc_NoticeCount();
		    		if($("#iframe .title .name").html()=="消息"){
		    		
				        if(plus.device.vendor=="Apple")
		    			{
							Init_Notice();
						}else {
							Init_Notice();
				        	var options = {cover:false};
				    		plus.push.createMessage(msg.title, "LocalMSG", options );
				        }
					}
		        }
		    	if(msg.payload=="2" || msg.payload=="{title:'',payload:'2'}")
				{
					Init_CircleNotice();
				}
		    }, false );
      		// 监听点击消息事件
      		
      		//监听从后台切换回前台,此方法android  ios都支持，但是在android下，只能远程打包后安装才起作用
      		document.addEventListener("resume",function(){
      			if($("#iframe .title .name").html()=="消息"){
      				Init_Notice();
      			}else
      			{
      				Get_NoticeCount();
      			}
      			if(plus.device.vendor!="Apple")
				{
      				plus.push.clear();
      			}
      		});
      		version=plus.device.model;
      		userid=plus.storage.getItem("crm_userid");
      		comid=plus.storage.getItem("crm_comid");
      		User=$.parseJSON(plus.storage.getItem("crm_user"));
      		addcrm=$("#addcrm");
      		addoa=$("#addoa");
      		addhr=$("#addhr");
      		Init_AddCRM();
      		Init_AddOA();
      		Init_AddHR();
      		if(userid!="" && userid!=null)
      		{
      			Init_Main();
      			Login_Update();
      		}else
      		{
      			Init_Login();
      		}
      		
			
      		var backButtonPress = 0;
					$$.back = function(event) {
						if (backButtonPress == 1) {
							var main = plus.android.runtimeMainActivity();
    						main.moveTaskToBack(false);
						} else {
							if($(".pswp__counter").html()!="")
							{
								$(".pswp__counter").html("");
								if(pswps)
								{
									pswps.close();
									return;
								}
								
							}
							if($(".customertool").length!=0 && $(".customertool").css("display")=="block")
							{
								$(".customertool").hide();
								return false;
							}
							if($("#divmsg400").length!=0)
							{
								CloseScreen();
								return false;
							}
							if($("#divmsg100").length!=0)
							{
								CloseMeng();
								return false;
							}
							if($(".divmsg").length!=0)
							{
								CloseWindow();
							}else
							{
								backButtonPress++; 
								plus.nativeUI.toast('再按一次退出应用');
							}
						}
						setTimeout(function() {
							backButtonPress = 0;
						}, 2000);
						return false;
					};
      	});
      	}(mui, document));
      	function Init_CircleNotice(){
      		var data = {};
			data.act = "Init_CircleNotice";
			data.userid=userid;
			data.comid=comid;
			data.sign=GetSign(data.act);
			mui.getJSON(index_domain, data, function(json) {
		        if(json.data.circlehead!="")
		        {
		        	$("#findcount").removeClass("hidden").attr("circlehead",json.data.circlehead);
		        	if($("#iframe .title .name").html()=="发现"){
		        		$("#circle .head").remove();
		        		$("#circle .quan").append('<div class="head"><img src="'+json.data.circlehead+'" width="32" height="32"><span class="hcircle"></span></div>');
		        	}
		        	if($("#divmsg2 .name").html()=="同事圈"){
		        		Receive_Circle2();
		        	}
		        }
			});
      	};
      	function Get_NoticeCount(){
      		var data = {};
			data.act = "Get_NoticeCount";
			data.userid=userid;
			data.comid=comid;
			data.sign=GetSign(data.act);
			mui.getJSON(index_domain, data, function(json) {
				var count=json.data.count;
		        plus.runtime.setBadgeNumber(count);
				if(count==0)
				{
					$("#noticecount").attr("class","hidden");
					$("#noticecount").html("");
				}else
				{
					$("#noticecount").removeClass("hidden");
					$("#noticecount").html(count>99?99:count);
				}
			});
      	};
      	function Inc_NoticeCount(){
      		$("#noticecount").removeClass("hidden");
      		if($("#noticecount").html()=="")
      		{
      			$("#noticecount").html("1");
      		}else
      		{
      			$("#noticecount").html(parseInt($("#noticecount").html())+1);
      		}
      	};
      	function reheight(new_height)
      	{
      		get("content").style.height=(document.documentElement.clientHeight - new_height)+ "px"; 
      	};
      	function Init_Script()
      	{
      		get("checkin").addEventListener("tap",function(){
      			$(".sign_checkin .shadow").css("-webkit-animation","halo 2s 0s infinite ease-out"); //第1个时间是运行多少秒  第2个时间是停顿多久
      			Get_Position(1);
      		});
      		get("sign_quan").addEventListener("tap",function(){
      			//$(".sign_checkin .shadow").css("-webkit-animation","");
      			plus.nativeUI.toast("请点击右侧按钮进行打卡");
      		});
      	};
      	var position_time;
      	function Get_Position(flag)
      	{
      		if(position_time)
      		clearTimeout(position_time);
      		$("#address").html("正在定位...");
      		GetNewPos(function(e){
      			if(e.address!="" && e.address!=null && e.address!="null")
      			{
      				$("#address").html(e.address);
      				if(flag==1)
      				{
      					if(User.SignRule.ID==0)
      					{
      						flag=0;
      						$(".sign_checkin .shadow").css("-webkit-animation","");
      						plus.nativeUI.alert("管理员还没有给您设置打卡规则，赶快联系他吧！");
      						return;
      					}
      					var point1 = new plus.maps.Point(e.longitude,e.latitude);
						var point2 = new plus.maps.Point(User.SignRule.Lng,User.SignRule.Lat);
						plus.maps.Map.calculateDistance(point1,point2,function(event){
							var distance = event.distance;  // 转换后的距离值
							if(distance>User.SignRule.Error)
							{
								flag=0;
								$(".sign_checkin .shadow").css("-webkit-animation","");
								OpenWindow(2,"外勤签到","保存",function(){
										Save_Sign();
								});
								$("#contentlist2").html(SignAdd_Code(e.address,e.latitude,e.longitude));
								Init_SignAdd();
							}
							else
							{
								Check_Sign(false,e);
							}
						},function(e){
	
						});
      				}
      			}
      			else
      			{
      				$("#address").html("获取位置信息失败，若一直失败，请重启软件试试");
      			}
      			
      		 });
      			position_time=setTimeout(function(){
				if($("#address").html()=="正在定位..." || $("#address").html()=="获取位置信息失败")
				{
					$("#address").html("获取位置信息失败，若一直失败，请重启软件试试");
					if(flag==1)
					{
						var e={address:"",latitude:0,longitude:0};
						Check_Sign(false,e);
					}
				}
				},10000);
};

function Init_Notice()
{
	var data = {};
	data.act = "Init_Notice";
	data.userid=userid;
	data.comid=comid;
	data.sign=GetSign(data.act);
	requests = mui.getJSON(index_domain, data, function(json) {
		if (json.data.sign.ID > 0) {
            $("#sign_quan").html(json.data.sign.SignState+"<br><font>"+json.data.sign.SignTime+"</font>");
        } else {
            $("#sign_quan").html("未签到<br><font>--</font>");
        }
        $(".sign_time .time2").html(Get_SignTime(json.data.signrule));
        $("#content ul").html(Notice_Data1(json.data.noticelist));
        Init_NoticeClick();
        User.SignRule=json.data.signrule;
        plus.storage.setItem("crm_user",JSON.stringify(User));
	});
};

function Init_Notice2() //用于批阅，完成任务，同意审批后执行
{
	var data = {};
	data.act = "Init_Notice";
	data.userid=userid;
	data.comid=comid;
	data.sign=GetSign(data.act);
	requests = mui.getJSON(index_domain, data, function(json) {
		if($("#iframe .title .name").html()=="消息"){
	        $("#content ul").html(Notice_Data1(json.data.noticelist));
	        Init_NoticeClick();
        }else
        {
        	Notice_Data1(json.data.noticelist);
        }
	});
};
function Init_User()
{
	CrmGetData(function(localuserlist){
			if(localuserlist.length>0){
			$("#content ul").html(Mate_Data1(localuserlist));
			}
			var data = {};
			data.act = "Find_DepartAndUser";
			data.source=source;
			data.pagesize=10000;
			data.userid=userid;
			data.comid=comid;
			data.sign=GetSign(data.act);
			requests = mui.getJSON(admin_domain, data, function(json) {
				if (json.data.count > 0) {
					var serveruserlist=json.data.user;
					if(localuserlist==0){
			        	$("#content ul").html(Mate_Data1(serveruserlist));
			        }
			        Update_UserMate(serveruserlist,localuserlist);
		        } else {
		            $("#content ul").html("");
		        }
			});
		
			
		
	});
};

var login_success=false; //主域名登录状态
function Init_Login(){
	
	$("body").html(Login_Code());
	get("login").addEventListener("tap", function(){
				$("#userpwd").blur();
      			var username=get("username").value;
      			var userpwd=get("userpwd").value;
      			if(username=="")
      			{
      				plus.nativeUI.toast("请输入登录账号");
      				return;
      			}
      			if(userpwd=="")
      			{
      				plus.nativeUI.toast("请输入登录密码");
      				return;
      			}
      			Begin_Login(username,userpwd); //先用主域名登录
      			setTimeout(function(){
      				if(login_success==false)
      				{
      					plus.nativeUI.closeWaiting();
      				    plus.nativeUI.toast("登录失败，请检查网络是否稳定");
      				}else
      				{
      					login_success=false;
      				}
      			},8000); //登录等待时长
      			
      		});
      		
      		get("regist_link").addEventListener("tap", function(){
      			Init_Regist();
      		});
      		get("findback_pwd").addEventListener("tap", function(){
      			Init_FindPwd();
      		});
      		var usernames=plus.storage.getItem("crm_username");
      		var userpwds=plus.storage.getItem("crm_userpwd");
      		get("username").value=usernames;
      		get("userpwd").value=userpwds;
};

function Begin_Login(username,userpwd){
	var client = plus.push.getClientInfo();
	var data={};
      			data.act="Login";
      			data.username=username;
      			data.userpwd=userpwd;
      			data.source=source;
      			data.version=version;
      			data.clientid=client.clientid;
      			data.token=client.token;
      			data.sign=GetSign(data.act);
      			data.editions=editions;
      			plus.nativeUI.showWaiting("正在登陆...");
      			CloseWaiting(10000);
      			mui.getJSON(login_domain, data, function(json){
      				setTimeout(function(){
      					plus.nativeUI.closeWaiting();
      				},10);
      				if(json.state)
      				{
      					login_success=true;
      					plus.storage.setItem("crm_username",username);
	                    plus.storage.setItem("crm_userpwd",userpwd);
      					if(json.data.length==1)
      					{
      						plus.nativeUI.toast(json.msg);
	                        User=json.data[0];

	                        plus.storage.setItem("crm_userid",User.ID.toString());
	                        plus.storage.setItem("crm_comid",User.ComID.toString());
	                        plus.storage.setItem("crm_user",JSON.stringify(User));
	                        userid=User.ID;
	                        comid=User.ComID;
	                        Init_AddCRM();
	                        Init_AddOA();
	                        Init_AddHR();
							Init_Main();
                        }
      					else
      					{
      						Init_Enter(json.data);
      					}
      				}else{
      					login_success==false
      					plus.nativeUI.toast(json.msg);
      					
      				}
      			}); 
};

function Init_Message(){
	$("#nav_oa").find("img").attr("src","img/qixins.png");
	$("#nav_crm").find("img").attr("src","img/mate.png");
	$("#nav_app").find("img").attr("src","img/app.png");
	$("#nav_find").find("img").attr("src","img/find.png");
	$("#nav_my").find("img").attr("src","img/me.png");
	$("#iframe").html(Notice_Code());
	$(".footer .name").css("color","#8f8f94");
	$("#nav_oa .name").css("color","#1795cf");
	reheight(245);
	Init_Script();
	Get_Position(0);
	Init_Notice();
};

function Init_BottomTool()
{
				Init_Script();
      			Get_Position(0);
      			Init_Notice(); 
      			$(".footer").css("top",sheight-50);
		      	get("nav_oa").addEventListener("tap",function(){
		      		if (requests) { requests.abort(); }
	      			Init_Message();
	      		});
	      		get("nav_crm").addEventListener("tap",function(){     			
	      			if (requests) { requests.abort(); }
	      			$("#nav_oa").find("img").attr("src","img/qixin.png");
	      			$("#nav_app").find("img").attr("src","img/app.png");
	      			$("#nav_find").find("img").attr("src","img/find.png");
	      			$("#nav_my").find("img").attr("src","img/me.png");
	      			$("#nav_crm").find("img").attr("src","img/mates.png");
	      			$("#iframe").html(Mate_Code());
	      			$(".footer .name").css("color","#8f8f94"); 
	      			$("#nav_crm .name").css("color","#1795cf");
	      			get("find").addEventListener("tap",function(){
	      				$("#searchicon").hide();
	      				$("#searchicons").show();
	      				$("#keyword").attr("placeholder","姓名，支持拼音"); 
	      			});
	      			Init_MateClick();
	      			//点击字母搜索
	      			mui(".search_content").on("tap",".search_square",function() {
	      				if($(this).hasClass("select"))
	      				{
	      					$(".search_content .search_square").removeClass("select").attr("class","search_square ui-border-radius");
	      				}else
	      				{
	      					$(".search_content .search_square").removeClass("select").attr("class","search_square ui-border-radius"); 
	      					$(this).addClass("select").removeClass("ui-border-radius");
	      				}
				        $("#matelist .list").removeClass("hidden");
				        if ($(this).hasClass("select")) {
				            $("#matelist .list[char!='" + $(this).html() + "']").addClass("hidden");
				            var count = $("#matelist .list:not([class*='hidden'])").length;
    						if (count == 0) {
						        if ($("#matelist .nodata").length == 0) {
						            $("#matelist").append('<div class="nodata">主人，没有找到相关同事！</div>');
						        } else {
						            $("#matelist .nodata").show();
						        }
						    }
						    else {
						        $("#matelist .nodata").hide();
						    }
				            //$("#matecount").html($("#matelist .list[char='" + $(this).html() + "']").length);
				        }
				        else {
				            //$("#matecount").html($("#matelist .list").length);
				            $("#matelist .nodata").hide();
				        }
	      			});
	      			get("find").addEventListener("tap",function(){
	      				$("#matelist .list").removeClass("hidden");
    					$(".search_content .search_square").removeClass("select").attr("class","search_square ui-border-radius"); 
    					if($("keyword").val()!="")
    					{
    						WorkMate_Search();
    					}
	      			});
	      			reheight(195);
	      			Init_User();
	      		});
	      		get("nav_app").addEventListener("tap",function(){
	      			if (requests) { requests.abort(); }
	      			$("#nav_oa").find("img").attr("src","img/qixin.png");
	      			$("#nav_crm").find("img").attr("src","img/mate.png");
	      			$("#nav_find").find("img").attr("src","img/find.png");
	      			$("#nav_my").find("img").attr("src","img/me.png");
	      			$("#nav_app").find("img").attr("src","img/apps.png");
	      			$("#iframe").html(Apply_Code());
	      			$(".footer .name").css("color","#8f8f94");
	      			$("#nav_app .name").css("color","#1795cf");
	      			Init_OAPanel(".oftenapp");
	      			Init_CRMPanel(".oftenapp");
	      			Init_HRPanel(".oftenapp");
	      			get("oa_panel").addEventListener("tap",function(){
	      				OpenWindow3(0,"办公OA","",null);
						$("#contentlist0").html(OAPanel_Code());
						Init_OAPanel(".allapp");
	      			});
	      			get("crm_panel").addEventListener("tap",function(){
	      				OpenWindow3(0,"销售CRM","",null);
						$("#contentlist0").html(CRMPanel_Code());
						Init_CRMPanel(".allapp");
	      			});
	      			get("hr_panel").addEventListener("tap",function(){
	      				OpenWindow3(0,"人力资源HR","",null);
						$("#contentlist0").html(HRPanel_Code());
						Init_HRPanel(".allapp");
	      			});
	      			if(DateDiff("S",User.EndDate,new Date().Format("yyyy-MM-dd hh:mm:ss"))>0){
	      			plus.nativeUI.confirm("欢迎使用企业袋鼠免费版，点击确认，升级为企业尊享版。点击取消，即可正常使用", function(event){
						if(event.index==1)
						{
							OpenWindow2(3,"版本升级","",function(){
							});
							$("#contentlist3").html(UpGrade_Code());
						}
					},"提示", ["取消","确认"]);
					}
	      		});
	      		get("nav_find").addEventListener("tap",function(){
	      			if (requests) { requests.abort(); }
	      			$("#nav_oa").find("img").attr("src","img/qixin.png");
	      			$("#nav_crm").find("img").attr("src","img/mate.png");
	      			$("#nav_app").find("img").attr("src","img/app.png");
	      			$("#nav_my").find("img").attr("src","img/me.png");
	      			$("#nav_find").find("img").attr("src","img/finds.png");
	      			$("#iframe").html(Find_Code());
	      			Init_Find();
	      			$(".footer .name").css("color","#8f8f94");
	      			$("#nav_find .name").css("color","#1795cf");
	      			reheight(95);
	      		});
	      		get("nav_my").addEventListener("tap",function(){
	      			if (requests) { requests.abort(); }
	      			$("#nav_oa").find("img").attr("src","img/qixin.png");
	      			$("#nav_crm").find("img").attr("src","img/mate.png");
	      			$("#nav_app").find("img").attr("src","img/app.png");
	      			$("#nav_find").find("img").attr("src","img/find.png");
	      			$("#nav_my").find("img").attr("src","img/mes.png");
	      			$("#iframe").html(My_Code());
	      			Init_My();
	      			$(".footer .name").css("color","#8f8f94");
	      			$("#nav_my .name").css("color","#1795cf");
	      			
	      			reheight(95);
	      		});
}; 

function Check_Sign(isearly,e) {
	var data = {};
	data.act = "Check_Sign";
	data.source = source;
	data.version = version;
	data.isearly = isearly;
	data.style=1; //上下班签到
	data.lat=e.latitude;
	data.lng=e.longitude;
	data.address=e.address;
	data.userid=userid;
	data.comid=comid;
	data.sign=GetSign(data.act);
	var array=[];
	mui.getJSON(index_domain, data, function(json) {
		if (json.state) {
			$("#sign_quan").html(json.data.SignState+"<br><font>"+json.data.SignTime+"</font>");
			$(".sign_checkin .shadow").css("-webkit-animation","");
			var html='<div class="signdialog"><div id="signclose" class="signclose">×</div><div class="signstate">打卡成功</div><div class="signoclock"><img src="img/oclock.png" width="100"/></div><div class="signtime">'+json.data.SignTime+'</div><div class="signstr">'+json.data.SignStr+'</div><div class="signauto">5 秒后自动关闭</div></div>';
			OpenMeng3(html,sheight/2-200);
			get("signclose").addEventListener("tap",function(){
				CloseMeng3();
			});
			tm=setInterval(AutoCloseSign,1000);
		}else
		{
			$(".sign_checkin .shadow").css("-webkit-animation","");
			if (json.msg == "您确定要早退吗？") {
				plus.nativeUI.confirm(json.msg, function(event){
					if(event.index==1)
					{
						Check_Sign(true,e);
					}
				},"提示", ["取消","确认"]);
            }else
            {
				plus.nativeUI.alert(json.msg);
			}
		}
	});
};

function AutoCloseSign(){
	if($(".signauto").length>0){
		var m = parseInt($(".signauto").html().substring(0,1));
		m=m-1;
		if(m>0){
			$(".signauto").html(m+" 秒后自动关闭");
		}else
		{
			clearInterval(tm);
			CloseMeng3();
		}
	}else
	{
		clearInterval(tm);
	}
};

</script>
</head>
<body>
	<script>
		$("body").html(AddCRM_Code()+AddOA_Code()+AddHR_Code());
	</script>
</body>
</html>